package com.cuanbobox.base;

import android.content.Context;
import android.os.Environment;

import com.yanzhenjie.andserver.annotation.Config;
import com.yanzhenjie.andserver.framework.config.WebConfig;
import com.yanzhenjie.andserver.framework.website.FileBrowser;

@Config
public class MyWebConfig implements WebConfig {
    @Override
    public void onConfig(Context context, Delegate delegate) {
        // 增加一个位于assets的web目录的网站
        //delegate.addWebsite(new AssetsWebsite(context, "/web/"));
        // 添加一个文件浏览器网站
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + "/html"));
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + "/log"));
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + "/apk"));
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + "/capture"));
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + "/classRoomInfo"));
        delegate.addWebsite(new FileBrowser(context.getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath()));
    }
}
